-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: zenstack generate warnings in pnpm repo with custom prisma client output dir #1876
Conversation
📝 WalkthroughWalkthroughThis pull request includes two main changes: an update to the version number in the JetBrains plugin's Changes
Assessment against linked issues
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
packages/schema/src/plugins/prisma/index.ts (2)
86-90
: LGTM! Consider adding path validation.The new logic correctly prioritizes custom Prisma client output paths, fixing the warning issues in pnpm repos.
Consider adding path validation to ensure the custom output path is valid:
if (clientOutput) { + // Validate custom output path + if (clientOutput.includes('..')) { + console.warn( + colors.yellow( + 'Custom Prisma client output path contains parent directory references (..). This might lead to unexpected behavior.' + ) + ); + } // if a custom prisma client output path is configured, first try treating // clientOutputDir as a relative path and locate the index.d.ts file prismaClientDtsPath = path.resolve(path.dirname(options.schemaPath), clientOutputDir, 'index.d.ts'); }
92-105
: Consider enhancing error handling with specific error details.While the fallback logic and warning message are clear, providing more specific error details could help with troubleshooting.
Consider enhancing the error handling:
} catch (err) { + const errorDetails = err instanceof Error ? `: ${err.message}` : ''; console.warn( colors.yellow( - `Could not resolve PrismaClient type declaration path. This may break plugins that depend on it.` + `Could not resolve PrismaClient type declaration path${errorDetails}. This may break plugins that depend on it.` ) ); + // Log the attempted paths for debugging + console.debug('Attempted paths:', { + direct: prismaClientDtsPath, + moduleResolution: clientOutputDir + }); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (13)
package.json
is excluded by!**/*.json
packages/ide/jetbrains/package.json
is excluded by!**/*.json
packages/language/package.json
is excluded by!**/*.json
packages/misc/redwood/package.json
is excluded by!**/*.json
packages/plugins/openapi/package.json
is excluded by!**/*.json
packages/plugins/swr/package.json
is excluded by!**/*.json
packages/plugins/tanstack-query/package.json
is excluded by!**/*.json
packages/plugins/trpc/package.json
is excluded by!**/*.json
packages/runtime/package.json
is excluded by!**/*.json
packages/schema/package.json
is excluded by!**/*.json
packages/sdk/package.json
is excluded by!**/*.json
packages/server/package.json
is excluded by!**/*.json
packages/testtools/package.json
is excluded by!**/*.json
📒 Files selected for processing (2)
packages/ide/jetbrains/build.gradle.kts
(1 hunks)packages/schema/src/plugins/prisma/index.ts
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- packages/ide/jetbrains/build.gradle.kts
fixes #1875